 
import { NgModule, Optional, SkipSelf } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from 'projects/xmly/src/app/app-routing.module'; 
import { DirectiveModule } from './directive/directive.module';
import { LayoutModule } from './layout/layout.module';

@NgModule({
  declarations: [],
  imports: [
    BrowserModule,
    AppRoutingModule,
    LayoutModule,
    DirectiveModule, 
  ],
  exports: [LayoutModule, DirectiveModule],
})
export class CoreModule {
  constructor(@SkipSelf() @Optional() parentModule: CoreModule) {
    if (parentModule) {
      throw new Error('CoreModule只能被AppModule调用!!!');
    }
  }
}
